package design_pattern.trigger;

import design_pattern.trigger.frame.*;

/**
 * @version 1.0.0
 * Created by cyd on 2022-08-29 17:11:53
 * @ClassName : design_pattern.trigger.Commoner
 * @Description : 具体的消费者实现类
 */
public class BadMan extends AbstractEventConsumer {

    //定义平民能够处理的事件的级别
    public BadMan() {
        super(EventConsumerType.NEW);
    }

    @Override
    public void exec(ProductEvent event) {
        //事件源头
        Product product = event.getSource();
        //事件类型
        ProductEventType type = event.getEventType();
        System.out.println("平民处理事件: " + product.getName() + "诞生记, 事件类型 = " + type);
    }

}
